<div th:fragment="details">

    <div class="modal fade" id="myModal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">操作日志详情</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="title" class="control-label">标题:</label>
                        <input type="text" class="form-control"  readonly="readonly" id="title" name="title">
                    </div>

                    <div class="form-group">
                        <label for="serviceType" class="control-label">业务类型:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="serviceType" name="serviceType">
                    </div>

                    <div class="form-group">
                        <label for="packageName" class="control-label">包名:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="packageName" name="packageName">
                    </div>

                    <div class="form-group">
                        <label for="methodName" class="control-label">方法名:</label>
                        <input type="text" class="form-control"   readonly="readonly"  id="methodName" name="methodName">
                    </div>

                    <div class="form-group">
                        <label for="requestMode" class="control-label">请求方式:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="requestMode" name="requestMode">
                    </div>

                    <div class="form-group">
                        <label for="requestUrl" class="control-label">请求地址:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="requestUrl" name="requestUrl">
                    </div>

                    <div class="form-group">
                        <label for="requestIp" class="control-label">请求Ip:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="requestIp" name="requestIp">
                    </div>

                    <div class="form-group">
                        <label for="requestPlace" class="control-label">请求位置:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="requestPlace" name="requestPlace">
                    </div>


                    <div class="form-group">
                        <label for="requestBrowser" class="control-label">请求浏览器:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="requestBrowser" name="requestBrowser">
                    </div>

                    <div class="form-group">
                        <label for="status" class="control-label">状态:</label>
                        <input type="text" class="form-control"  readonly="readonly"   id="status" name="status">
                    </div>

                    <div class="form-group">
                        <label for="openName" class="control-label">操作人:</label>
                        <input type="text" class="form-control"    readonly="readonly" id="openName" name="openName">
                    </div>
                    <div class="form-group">
                        <label for="openTime" class="control-label">操作时间:</label>
                        <input type="text" class="form-control"   readonly="readonly" id="openTime" name="openTime">
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>

            </div>
        </div>
    </div>

    <script>
        //加載用戶編輯彈框
        function EditViewById(id){
            $('#myModal').modal();
            const data = {
                id: id
            };
            myrequest("/admin/openLog/details",data,'GET',function(data){
                $("#title").val(data.data.title);
                const serviceType = data.data.serviceType;
                if (serviceType === 0) {
                    $("#serviceType").val('其他');
                } else if (serviceType === 1) {
                    $("#serviceType").val('新增');
                }else if (serviceType === 2) {
                    $("#serviceType").val('删除');
                }else if (serviceType === 3) {
                    $("#serviceType").val('修改');
                }
                $("#packageName").val(data.data.packageName);
                $("#methodName").val(data.data.methodName);
                $("#requestMode").val(data.data.requestMode);
                $("#requestUrl").val(data.data.requestUrl);
                $("#requestIp").val(data.data.requestIp);
                $("#requestPlace").val(data.data.requestPlace);
                $("#requestBrowser").val(data.data.requestBrowser);
                const status = data.data.status;
                if (status === 1) {
                    $("#status").val('正常');
                } else if (status === 2) {
                    $("#status").val('异常');
                }
                $("#openName").val(data.data.openName);
                $("#openTime").val(data.data.openTime);
            }, function(data){
                toastr.error(data.msg);
            })
        }

    </script>

</div>